@extends('admin.layouts._menu')
@section('content')
    <div class="card">
        <div class="card-body">
            <ul class="nav nav-tabs nav-overflow header-tabs">
                <li class="nav-item">
                    <a href="" class="nav-link pb-3 active">
                        订单列表
                    </a>
                </li>
            </ul>
        </div>
        <div class="card-body">
            <table class="table">
                <thead>
                <tr>
                    <th>编号</th>
                    <th>付款用户</th>
                    <th>收货地址</th>
                    <th>收货人</th>
                    <th>订单编号</th>
                    <th>订单总额</th>
                    <th>下单日期</th>
                    <th>订单状态</th>
                    <th></th>
                </tr>
                </thead>
                <tbody>
                @foreach($orders as $order)
                    <tr>
                        <td scope="row">{{$order['id']}}</td>
                        <td>{{$order->user->name}}</td>
                        <td>{{$order->address->area}} {{$order->address->address}}</td>
                        <td>{{$order->address->linkname}}</td>
                        <td>{{$order['order_num']}}</td>
                        <td>￥{{$order['total_price']}}
                        <td>{{$order['created_at']}}</td>
                        <td>
                            {{$order['status']}}
                        </td>
                        <td>
                            <a href="{{route('admin.order.changeStatus',$order)}}" class="btn btn-light">修改状态</a>
                            {{--<button type="button" class="btn btn-outline-info">Info</button>--}}
                        </td>
                    </tr>
                @endforeach
                <td>{{$orders->links()}}</td>
                </tbody>
            </table>
        </div>
    </div>
@endsection
